home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / ModelEdMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.8 KB  |  92 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  28 June 1996
  22. // Author:         jb
  23. //
  24. //
  25. //  Procedure Name:
  26. //      ModelEdMenu
  27. //
  28. //  Description:
  29. //      This procedure creates the popup/marking menu
  30. //      that gets attached to the main view panes.  
  31. //        This menu builds dynamically, and changes its
  32. //        contents based what item the mouse is clicked over.
  33. //
  34. //  Input Arguments:
  35. //      The parent item to parent the popup menu to.
  36. //
  37. //  Return Value:
  38. //      None.
  39. //
  40.  
  41.  
  42. global proc ModelEdMenu( string $panelName ) {
  43.  
  44.     global int $gIsMarkingMenuOn;
  45.  
  46.     //  Find out current location of the panel and ensure that it has
  47.     //  a control layout associated with it.
  48.     //
  49.     string $panelControl = `modelEditor -q -control $panelName`;
  50.     if( $panelControl != "" )
  51.     {
  52.         //    regular popup mappings.
  53.         int $objectButton = 3;
  54.         int $ctlObjectQualifier = 0;
  55.         int $shObjectQualifier = 0;
  56.             
  57.         string $objectMenuName = ( $panelName + "ObjectPop" );
  58.         string $convertMenuName = ( $panelName + "ConvertPop" );
  59.  
  60.         // Build the object specific menu
  61.         if( !`popupMenu -exists $objectMenuName` )
  62.         {
  63.             string $fullObjectMenuName = `popupMenu -parent $panelControl $objectMenuName`;
  64.  
  65.             string $buildObjectMenuItemsNow =  "buildObjectMenuItemsNow";
  66.  
  67.             popupMenu -e 
  68.                 -mm $gIsMarkingMenuOn
  69.                 -button $objectButton 
  70.                 -sh $shObjectQualifier  
  71.                 -ctl $ctlObjectQualifier 
  72.                 -aob true 
  73.                 -pmc (  $buildObjectMenuItemsNow + " \"" + $fullObjectMenuName + "\"")
  74.                 $objectMenuName;
  75.         }
  76.  
  77.         if (!`popupMenu -exists $convertMenuName`) {
  78.             
  79.             string $fullConvertMenuName = `popupMenu -parent $panelControl
  80.                 -allowOptionBoxes true $convertMenuName`;
  81.             string $buildConvertMM = "buildConvertMM";
  82.  
  83.             popupMenu -edit
  84.                 -markingMenu $gIsMarkingMenuOn 
  85.                 -ctrlModifier true 
  86.                 -button 3 
  87.                 -postMenuCommand ($buildConvertMM + " \"" + $fullConvertMenuName + "\"")
  88.                 $convertMenuName;
  89.         }
  90.     }
  91. }
  92.